var TAG = "listPageHml----"
var count = 1
var LoadCount = 1
export default {
    data: {
        isShowHeader: true,
        list: [],
    },
    onInit() {
        for (var index = 0; index < 20; index++) {
            this.list.push("原始数据：：" + index)
        }
    },
    onRefresh(e) {
        console.log(TAG + " onRefresh()")
        setTimeout(() => {
            this.list.length = 0
            for (var index = 0; index < 22; index++) {
                this.list.push("第" + count + "更新数据：：" + index)
            }
            count++
            e.detail.resolveFunc()
            this.$child("refreshLoadMoreComponent").isShowLoadMoreViewFunc(true);
        }, 2000)
    },
    onLoadMore(e) {
        console.log(TAG + " onLoadMore()")
        setTimeout(() => {
            if (this.list.length > 25) {
                e.detail.resolveFunc()
                this.$child("refreshLoadMoreComponent").isShowLoadMoreViewFunc(false);
                return;
            }
            this.list.push("加载数据：：" + LoadCount)
            LoadCount++
            e.detail.resolveFunc()
        }, 1000)
    },
    onRefreshState(e) {
        console.log(TAG + " onRefreshState state : " + e.detail.state)
    }
}